function strToHexCharCode(str) {
    if (str === "")
        return "";
    var hexCharCode = [];
    hexCharCode.push("0x");
    for (var i = 0; i < str.length; i++) {
        hexCharCode.push((str.charCodeAt(i)).toString(16));
    }
    return hexCharCode.join("");
}











function hexCharCodeToStr(hexCharCodeStr) {
    var trimedStr = hexCharCodeStr.trim();
    var rawStr =
        trimedStr.substr(0, 2).toLowerCase() === "0x" ?
        trimedStr.substr(2) :
        trimedStr;
    var len = rawStr.length;
    if (len % 2 !== 0) {
        alert("Illegal Format ASCII Code!");
        return "";
    }
    var curCharCode;
    var resultStr = [];
    for (var i = 0; i < len; i = i + 2) {
        curCharCode = parseInt(rawStr.substr(i, 2), 16); // ASCII Code Value
        resultStr.push(String.fromCharCode(curCharCode));
    }
    return resultStr.join("");
}

//16进制ascii码转字符串
let code = ["0x41", "0x54", "0x2B", "0x43", "0x49", "0x50", "0x53", "0x54", "0x41", "0x52", "0x54", "0x3D", "0x22", "0x54", "0x43", "0x50", "0x22", "0x2C", "0x22", "0x31", "0x39", "0x32", "0x2E", "0x31", "0x36", "0x38", "0x2E", "0x31", "0x2E", "0x31", "0x31", "0x30", "0x22", "0x2C", "0x31", "0x32", "0x33", "0x34"]
let str = ''
for (let index = 0; index < code.length; index++) {
    const element = code[index];
    str += hexCharCodeToStr(element)
}
console.log(str)

//字符串转16进制ascii码
let ip = `AT+CIPSTART="TCP","192.168.1.110",1234`
let decode = []
for (let index = 0; index < ip.length; index++) {
    const element = ip[index];
    decode.push(strToHexCharCode(element))

}
console.log(decode.join(","))